/**
 * Created by 小敏哥 on 2017/8/16.
 */
import React, {Component} from 'react';
import style from './index.scss';

class PayTypeList extends Component {
    constructor(props) {
        super(props);
    }

    //根据终端类型展示不同的支付通道
    changePayTypesByClient() {
        let userChannel = typeOfBrowser.getChannelOfBrowser();
        if (userChannel == 'aliPay') {
            this.setState({
                payTypes: [],
                payType: this.props.payTypes[0]
            })
        }
        else if (userChannel == 'weixin') {
            this.setState({
                payTypes: [],
                payType: this.props.payTypes[1]
            })
        }
        else if (userChannel == 'qq') {
            this.setState({
                payTypes: [],
                payType: {
                    name: 'qq',
                    type: '4',
                }
            })
        }
        else if (userChannel == 'app') {
            //疑似跟其他setState操作冲突，导致无法更新状态，估排到队列最后执行
            setTimeout(() => {
                this.setState({
                    payTypes: this.props.payTypes,
                })
            }, 0);
        }

    }

    render(){

    }
}

export default PayTypeList;